package com.zgz.underwrite.dao.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import com.zgz.underwrite.dao.DepartmentDao;
import com.zgz.underwrite.model.Department;

public class DepartmentDaoImpl extends BaseDaoImpl<Department> implements
		DepartmentDao {

	public long getDeptCount() {
		String hql = "From Department d";
		@SuppressWarnings("unchecked")
		List<Department> list = super.getHibernateTemplate().find(hql);
		return list.size();
		
	}
	
	@SuppressWarnings("unchecked")
	public List<Department> findByPage(DetachedCriteria criteria, int firstResult, int maxResults){
		return super.getHibernateTemplate().findByCriteria(criteria, firstResult, maxResults);
	}
	
}
